function handles = addGroup(handles)
% addGroup
% 
% Editing:
% gs may 2005
% ----------------------------------------------------

% prompt user for new name
newName = inputdlg('Name of new group to add:');
newName = newName{1};
if isempty(newName)
    return
end

% determine how many groups there are already, add this one to end, make current
groups = get(handles.groupList, 'String');
if isempty(groups) % must be a new blank file
    val = 1;
else
    val = size(groups, 1) + 1;
end
groups{val} = newName;
set(handles.groupList, 'String', groups);
set(handles.groupList, 'Value', val);

% rename as needed in the handles structure
listsAndExpts = handles.analysis.mapAverager.cellLists.currentFile.listsAndExpts;
listsAndExpts( size(listsAndExpts,1) + 1, 1) = {newName};
listsAndExpts( size(listsAndExpts,1), 2) = {{'(hit add)'}};

% store new name within the handles structure
handles.analysis.mapAverager.cellLists.currentFile.listsAndExpts = listsAndExpts;

handles = updateLists(handles);
handles = saveListFile(handles);
